import type { CommonResult, CommonPage } from '@/models/request'
import type { ReturnApply, ReturnApplyDto, ReturnApplyPageDto } from '@/models/returnApply'
import request from '@/utils/request'
export function fetchList(params: ReturnApplyPageDto) {
  return request<CommonPage<ReturnApply>>({
    url: '/returnApply/list',
    method: 'get',
    params: params,
  })
}

export function deleteApply(params: { ids: string }) {
  return request<CommonResult>({
    url: '/returnApply/delete',
    method: 'post',
    params: params,
  })
}
export function updateApplyStatus(data: ReturnApplyDto) {
  return request<CommonResult>({
    url: '/returnApply/update/status/' + data.id,
    method: 'post',
    data: data,
  })
}

export function getApplyDetail(id: number) {
  return request<CommonResult<ReturnApply>>({
    url: '/returnApply/' + id,
    method: 'get',
  })
}
